Pico (programming language)
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
Pico is a programming language developed at the Software Languages Lab at Vrije Universiteit Brussel, intended to be simple, powerful, extensible, and easy to read.cite-ref-pico-d-r-1-0[1] The language was created to introduce the essentials of programming to non-computer science students.
While designing Pico, the Software Languages Lab was inspired by the Abelson and Sussman's book "Structure and Interpretation of Computer Programs". Furthermore, they were influenced by the teaching of programming at high school or academic level.
Pico should be interpreted as 'small', the idea was to create a small language for educational purposes.
Contents
• Comments
• Windows
• Linux
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Language elements
De Meuter, Gonzalez, and D'Hondt describe the Pico syntax as being "two-tiered."cite-ref-pico-d-r-1-1[1] The first layer consists of simple rules for writing small programs in a functional programming style.
Comments
Variables
Functions
Functions, like everything in Pico, are first-class objects, meaning they can be assigned to variables and passed to and returned from functions. Also, there are no anonymous functions in Pico; functions must have a name.cite-ref-pico-d-r-1-2[1] For example, a function, func, with two parameters, param1 and param2, can be defined as:
func(param1, param2): ...
Functions can be called with the following syntax:
func(arg1, arg2)
Operators
Operators can be used as prefix or infix in Pico:
+(5, 2)
5 + 2
Data types
It does not have a native char type, so users should resort to size 1 strings.
Tables are compound data structures that may contain any of the regular data types.
Boolean types are represented by functions (as in lambda calculus).
Control structures
Conditional evaluation
Only the usual if statement is included
if(condition, then, else)
Code snippets
display('Hello World', eoln)
max(a, b):
if(a < b, b, a)
`http://www.paulgraham.com/accgen.html`
foo(n): fun(i): n := n+i
Implementations
Mac OS, Mac OS X
• MacPico
• XPico
Windows
• WinPico This version is buggy
• WinPico stable
Linux
• TextPico for Linux
Cross-platform
• sPico for DrScheme
References
cite-note-pico-d-r-11. ↑ citerefd-hondtgonzalezde-meuter1999D'Hondt, Theo; Gonzalez, Sebastian; De Meuter, Wolfgang (1 January 1999). "The design and rationale behind pico". Programming Technology Lab, Department of Computer Science, Vrije Universiteit Brussel. Retrieved 3 December 2023.
External links